<template>
  <view class="collectionShopItem app_container_collectionShopItem" @click="handleClick">
    <image :src="collection.storeThumbnail" mode=""></image>
    <view class="contentRight">
      <view class="title">{{ collection.storeName }}</view>
      <view class="region"> {{ collection.storeAddress }} </view>
      <view class="time"> 收藏时间：{{ dayjs(collection.createTime).format('YYYY/MM/DD') }} </view>
    </view>
  </view>
</template>

<script>
import dayjs from 'dayjs'
export default {
  props: {
    collection: {
      type: Object
    }
  },
  data() {
    return {
      dayjs: null
    }
  },
  created() {
    this.dayjs = dayjs
  },
  methods: {
    handleClick() {
      this.$emit('CollectionShop_CARD_CLICK', this.collection)
    }
  }
}
</script>

<style lang="scss">
app-mycollection-shop-card {
  display: block;
}
.collectionShopItem {
  width: 100%;
  height: 160rpx;
  background: #ffffff;
  box-shadow: 0px 10rpx 40rpx 0px rgba(0, 0, 0, 0.1);
  border-radius: 40rpx;
  display: flex;
  align-items: center;
  font-size: 24rpx;
  image {
    width: 240rpx;
    height: 160rpx;
  }
  .contentRight {
    flex: 1;
    padding: 0 34rpx;
    view {
      height: 42rpx;
      line-height: 42rpx;
    }
    .title {
      width: 415rpx;
      font-size: 30rpx;
      @include text-ellipsis();
    }
    .region {
      width: 415rpx;
      font-size: 24rpx;
      @include text-ellipsis();
    }
  }
}
</style>
